let ws = require('ws');

let wss = new ws.WebSocketServer({port:9974});

wss.on('connection',(ws)=>{
    // ws.send('欢迎你');
    ws.on('message',data=>{
        console.log(data.toString());

        wss.clients.forEach(client=>{
            if(client!=ws){
                client.send(data.toString())
            }
        })
    })
})